
<div class="login-ajax">
	<form id="frm-login" action="<?php echo site_url('c=member&m=ajax_login_do');?>"
		submitbefor="frm_login_befor"
	>
	<table class="tbl-frm-1">
		<tr>
			<th width="60">邮 箱：</th>
			<td>
				<input class="inp" type="text" name="email"/>
				<span id="tip-email" class="tip"></span>
				
			</td>
		</tr>
		<tr>
			<th>密 码：</th>
			<td>
				<input class="inp" type="password" name="upass"/>
				<span id="tip-upass" class="tip"></span>
			</td>
		</tr>
		<tr>
			<th>&nbsp;</th>
			<td class="p1"><input class="btn btn-ajax-submit" frmid="frm-login" type="button"/></td>
		</tr>
	</table>
	</form>
</div>

<script>
function frm_login_befor($frm){
	var email = $frm.find('input[name=email]').val().trim();
	if(email.length == 0){
		$('#tip-email').addClass('c1').html('').html('邮箱不能为空！');
	}else if(email.length != 0 && !isEmail(email)){
		$('#tip-email').addClass('c1').html('').html('邮箱格式不正确！');	
	}else{
		$('#tip-email').html('');	
	} 

	var password = $frm.find('input[name=upass]').val().trim();
	if(password.length == 0){
		$('#tip-upass').addClass('c1').html('').html('密码不能为空^^！');
	}else if(password.length != 0 && !isUpass(password)){
		$('#tip-upass').addClass('c1').html('').html('错误的格式！');	
	}else{
		$('#tip-upass').html('');	
	} 

	if($frm.find('.c1').size()>0) return false;
	
	return true;	
	
	
}

ajaxinit();
</script>